package actionForm;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

public class CreateContactGroupValidationForm extends ActionForm {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String groupName = null;

	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupeName) {
		this.groupName = groupeName;
	}
	
	public ActionErrors validate(
			ActionMapping mapping, HttpServletRequest request ) {
		ActionErrors errors = new ActionErrors();
		if( getGroupName()== null || getGroupName().length() < 1 ) {
			errors.add("group name",new
					ActionMessage("creation.gn.error.required"));
		}
		return errors;
	}
}
